package com.gxd.esimport;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;

public class Main {





    public static void main(String[] args) {

        pipe simplePipe = new pipe();

        try {
            System.out.println("同步开始时间："+new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
            for(int i=0;i<5;i++ ){
                outputThread outputThread = new outputThread(simplePipe.simpleArrayConcurrentQueue);
                outputThread.initESClient();
                simplePipe.outputExecutorService.submit(outputThread);
            }
            JdbcClientHelper.getConnection();

            tableList.initNavTables();

            for (Table table:tableList.NavTables){
                inputThread inputThread = new inputThread(table,simplePipe.simpleArrayConcurrentQueue);
                simplePipe.inputExecutorService.submit(inputThread);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
